feat(xpkg): add --annotation flag to xpkg build and xpkg push#11
feat(xpkg): add --annotation flag to xpkg build and xpkg push#11chaitanyapantheor wants to merge 4 commits into
Conversation
|
ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
🚧 Files skipped from review as they are similar to previous changes (5)
📝 WalkthroughWalkthroughThis PR adds support for setting OCI image annotations via ChangesOCI Annotation CLI Support
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related issues
🚥 Pre-merge checks | ✅ 6✅ Passed checks (6 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Signed-off-by: Chaitanya Maili <chaitanya.maili@pantheon.io>
Signed-off-by: Chaitanya Maili <chaitanya.maili@pantheon.io>
Signed-off-by: Chaitanya Maili <chaitanya.maili@pantheon.io>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Chaitanya Maili <chaitanya.maili@pantheon.io>
4476efa to
a8a515b
Compare
adamwg
left a comment
There was a problem hiding this comment.
I've left a couple of thoughts, but overall this looks good to me and seems like a valuable feature.
| Package string `arg:"" help:"Where to push the package. Must be a fully qualified OCI tag, including the registry, repository, and tag." placeholder:"REGISTRY/REPOSITORY:TAG"` | ||
|
|
||
| // Flags. Keep sorted alphabetically. | ||
| Annotation []string `help:"An OCI manifest annotation to add to the package in key=value format. Repeatable." placeholder:"KEY=VALUE" short:"a"` |
There was a problem hiding this comment.
I wonder if this should be OCIAnnotation / --oci-annotation or something like that to make it clear how it's different from the metadata.annotations.
| return errors.Wrapf(err, errAnnotateLayers) | ||
| } | ||
|
|
||
| img = annotateImage(img, annotations) |
There was a problem hiding this comment.
Should we apply the same annotations to the index (built below with mutate.AppendManifests)?
| @@ -0,0 +1,49 @@ | |||
| /* | |||
| Copyright 2025 The Crossplane Authors. | |||
Description of your changes
Adds a repeatable
--annotation/-a KEY=VALUEflag tocrossplane xpkg buildand
crossplane xpkg push, allowing users to attach OCI manifest annotationsto packages at build or push time.
Annotations are applied to the OCI image manifest. Malformed annotations
(missing =) return an error before any write or push occurs. Reading
annotations from crossplane.yaml is intentionally out of scope to avoid
silently propagating internal Crossplane annotations to the OCI registry.
Covered by unit tests in cmd/crossplane/xpkg/annotations_test.go.
Fixes crossplane/crossplane#7282
I have:
./nix.sh flake checkto ensure this PR is ready for review.backport release-x.ylabels to auto-backport this PR.